#pragma once
#include "Global.h"
/*******************************************************
 * Filename: R2S.h
 * Description:The head file of R2S method 
 * Author: Chengwei Liu
 * Date: 2024-10-21
 * Version: 1.0
 * Modification Log:
 *******************************************************/
void Start_R2S();

string readConfigureFile(const std::string& filePath, double& activationFlux, double& neuNps, double& phoNps, int& iints, int& jints, int& kints);
double ReadNeutronTransportFile(const std::string& filePath, double activationFlux);
double ReadPhotonTransportFile(const std::string& filePath, double activationFlux);
double ReadR2STransportFile(const std::string& filePath, double activationFlux);

double ReadTallyValue(const std::string& filePath, double activationFlux, string tallyNumber);
void FindTallyCharts(string tally_line, vector<string> tally_string, map<string, double>& tally_map);
int FindStrNum(string origin, string find_str);
string get_string_withoutspace(string S_TR, int num);
string get_string_withoutspace(std::string S_TR, int num, int& seat, int& seat2);

bool processFileContent(const std::string& filePath);
bool appendToFile(const std::string& filePath, double phoNps, const std::string& gammaFilePath, int gridCount);
bool appendWeightsToFile(const std::string& filePath, const std::string& gammaFilePath, int gridCount, double& totalGamma);
bool appendGammaGroupsToFile(const std::string& filePath, const std::string& gammaPerGroupFilePath, int gridCount);
bool replaceLinesInFile(const std::string& filePath);
